#ifndef	__BFX_REFXMLCDATASECTION_H__
#define	__BFX_REFXMLCDATASECTION_H__

namespace BFX
{

//////////////////////////////////////////////////////////////////////////////

// Used to quote or escape blocks of text to keep that text from being interpreted as markup language.
class REFXMLCDataSection : public REFXMLLinkedNode
{
	friend class REFXMLDocument;
protected:
	REFXMLCDataSection(const UniString& strData, REFXMLDocument* pDoc);

public:
	virtual ~REFXMLCDataSection();

	// Gets the name of the node.
	virtual UniString GetName() const;

	// Gets the name of the node without the namespace prefix.
	virtual UniString GetLocalName() const;

	// Gets the type of the current node.
	virtual XMLNodeType GetNodeType() const;

	virtual REFXMLNode* GetParentNode() const;

	// Saves the node to the specified XmlWriter.
	virtual void WriteTo(REFXMLWriter* w) const;

	// Saves the node content to the specified XmlWriter.
	virtual void WriteContentTo(REFXMLWriter* w) const;

	// Gets or sets the value of the node.
	virtual UniString GetValue() const;
	virtual void SetValue(const UniString& str);

	// Gets or sets the concatenated values of the node and all its children.
	virtual UniString GetInnerText() const;
	virtual void SetInnerText(const UniString& str);

protected:
	virtual bool IsText() const;
	virtual REFXMLNode* GetPreviousText() const;

private:
	UniString	m_strValue;
};

}	//	namespace BFX

#endif	//	__BFX_REFXMLCDATASECTION_H__
